of

open fun of(key: String, value: String): MultipartFormData.Pair

Returns the Pair instance for the given key and value.

The key-value pair that represents a segment of a multi-part form data. Can contain values corresponding a form field content, an upload file content, etc.

Parameters

key

the form content segment key

value

the string representing the form content segment value. Can be empty if the key does not correspond to any value. For example, an empty form field

Throws

when key is empty or blank


open fun of(key: String, value: File): MultipartFormData.Pair

Returns the Pair instance for the given key and value.

The key-value pair that represents a segment of a multi-part form data. Can contain values corresponding a form field content, an upload file content, etc.

Parameters

key

the form content segment key

value

the segment value representing the file content

Throws

when key is empty